home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
tlx_sq21.zip
/
PUTLINE.SLT
< prev
next >
Wrap
Text File
|
1992-03-20
|
2KB
|
68 lines
//-----------------------------------------------------------
// PutLine.SL? Output line to BBS without generating errors.
//-----------------------------------------------------------
// If you have suggestions for improving this script, please suggest
// improvements to me via old-fashioned snail-mail to:
// Author: Inge Vabekk
// Hamangskogen 108
// N-1300 SANDVIKA
// NORWAY
// tel. (472) 546 396
//-----------------------------------------------------------
// PutLine script is entered here.
//-----------------------------------------------------------
main (str text, int CR)
{
int i, j, k, l, w, save;
str check [80];
if (!carrier()) return (-1);
save = _scr_chk_key; // Save ESC option.
_scr_chk_key = 1;
l = get_baud();
if (l > 9600) l = 9600;
w = 19200/l;
l = strlen (text); // Get length of text.
if (subchr (text,l-1)==CR) // Terminated by CR?
setchr (text,--l,0); // Yes, delete it.
for (i=0; i<3; ++i)
cputc (8); // Remove possible line noise.
for (i=0; i<3; ++i) // Three attempts.
{ cputs (text); // Write text.
if (l < 3) goto OK; // If < 3 chars, skip checks.
for (j=0; j<10; ++j)
{ do
{ terminal(); // Process all echo
k = getx()-l-3; // Get position.
if (k<0) k=0;
vgetchrs(k,gety(),check,0,80); // Get line from screen.
if (strposi (check,text,0) >= 0)// Compare.
goto OK;
delay(w); // Wait a little, then continue.
} while (cinp_cnt() > 0);
}
for (j=-3; j<l; ++j)
cputc (8); // Delete erroneous entry
} // and try again.
prints ("");
prints ("T²: Attempts failed.");
printsc ("Check = ");
prints (check);
printsc ("Text = ");
prints (text);
cputs (text); // Error: One last try.
OK:
if (CR) cputc (CR); // Send CR if wanted.
_scr_chk_key = save; // Restore ESC option.
}